/**************************************************************************************
*  sys_native_tbl.c
*
*  This file contains sys_native_tbl listing native methods for system paclakges 
*  defined in the ClassLinker's control file.
*
**************************************************************************************
*
*  The contents of this file are subject to the RTJ COMPUTING non-commercial
*  source code license agreement ("License"); you may not use this file except in
*  compliance with the License. A copy of the License (license.terms) can be
*  found in the root of installation folder or on the web at
*  http://www.rtjcom.com/Files/license.terms
*
*  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
*  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
*  MERCHANTABILITY,  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
*  IN NO EVENT SHALL RTJ COMPUTING BE LIABLE FOR ANY CLAIM, DAMAGES
*  OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
*  ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
*  OTHER DEALINGS IN THE SOFTWARE.
*
*  Copyright (c) 2000-2002 RTJ Computing Pty. Ltd. All rights reserved.
*
**************************************************************************************/
#include "jvm.h"
#include "jlang.h"

int16 lpc2xxx_hw_Console_print(int32 par[], int32 *rv);
int16 lpc2xxx_hw_Console_getKey(int32 par[], int32 *rv);
int16 lpc2xxx_hw_Console_keyAvail(int32 par[], int32 *rv);
int16 lpc2xxx_hw_Console_putch(int32 par[], int32 *rv);

int16 lpc2xxx_hw_GPIO_read(int32 param[], int32 *retval);
int16 lpc2xxx_hw_GPIO_set(int32 param[], int32 *retval);
int16 lpc2xxx_hw_GPIO_clear(int32 param[], int32 *retval);
int16 lpc2xxx_hw_GPIO_config(int32 param[], int32 *retval);
int16 lpc2xxx_hw_GPIO_iodir(int32 param[], int32 *retval);

int16 lpc2xxx_hw_RTC_init(int32 par[], int32 *rv);
int16 lpc2xxx_hw_RTC_set(int32 par[], int32 *rv);
int16 lpc2xxx_hw_RTC_get(int32 par[], int32 *rv);

int16 lpc2xxx_comm_SPI_init(int32 par[], int32 *rv);
int16 lpc2xxx_comm_SPI_command(int32 par[], int32 *rv);
int16 lpc2xxx_comm_SPI_ready(int32 par[], int32 *rv);

int16 lpc2xxx_comm_UART_open0(int32 par[], int32 *rv);
int16 lpc2xxx_comm_UART_close0(int32 par[], int32 *rv);
int16 lpc2xxx_comm_UART_purge0(int32 par[], int32 *rv);
int16 lpc2xxx_comm_UART_getStatus0(int32 par[], int32 *rv);
int16 lpc2xxx_comm_UART_dataAvail(int32 par[], int32 *rv);
int16 lpc2xxx_comm_UART_read0(int32 par[], int32 *rv);
int16 lpc2xxx_comm_UART_write0(int32 par[], int32 *rv);

int16 lpc2xxx_hw_PWM_init0(int32 param[], int32 *retval);
int16 lpc2xxx_hw_PWM_freq(int32 param[], int32 *retval);
int16 lpc2xxx_hw_PWM_duty(int32 param[], int32 *retval);
int16 lpc2xxx_hw_PWM_apply(int32 param[], int32 *retval);

int16 lpc2xxx_comm_I2C_init0(int32 param[], int32 *retval);
int16 lpc2xxx_comm_I2C_start(int32 param[], int32 *retval);
int16 lpc2xxx_comm_I2C_reStart(int32 param[], int32 *retval);
int16 lpc2xxx_comm_I2C_stop(int32 param[], int32 *retval);
int16 lpc2xxx_comm_I2C_status(int32 param[], int32 *retval);
int16 lpc2xxx_comm_I2C_write(int32 param[], int32 *retval);
int16 lpc2xxx_comm_I2C_read(int32 param[], int32 *retval);
int16 lpc2xxx_comm_I2C_poll(int32 param[], int32 *retval);

int16 lpc2xxx_hw_ADC_init(int32 param[], int32 *retval);
int16 lpc2xxx_hw_ADC_get(int32 param[], int32 *retval);
int16 lpc2xxx_hw_ADC_getmV(int32 param[], int32 *retval);

int16 lpc2xxx_hw_DAC_set(int32 param[], int32 *retval);

/*
** System native method lookup table.
** IMPORTANT:
**   Order of methods this table must exactly match the method order in
**   the ClassLinker.control file. Otherwise, incorrect native method might
**   be invoked and can eventually cause the system to crash!
*/
const native_func_ptr sys_native_tbl[] =
{
    /* java.lang.System methods */
    java_lang_System_arraycopy,
    java_lang_System_freeMemory,
    java_lang_System_totalMemory,
    java_lang_System_gc,
    java_lang_System_currentTimeMillis,
    java_lang_System_getPropertyLen,
    java_lang_System_getProperty0,
    /* java.lang.Thread methods */
    java_lang_Thread_start,
    java_lang_Thread_stop,
    java_lang_Thread_suspend,
    java_lang_Thread_resume,
    java_lang_Thread_yield,
    java_lang_Thread_isAlive,
    java_lang_Thread_sleep0,
    java_lang_Thread_interrupt0,
    java_lang_Thread_currentThread,
    java_lang_Thread_setDaemon0,
    /* java.lang.Throwable methods */
    java_lang_Throwable_fillInStackTrace,
    java_lang_Throwable_getStackTrace,
    /* java.lang.Object methods */
    java_lang_Object_hashCode,
    java_lang_Object_wait0,
    java_lang_Object_notify,
    java_lang_Object_notifyAll,
    java_lang_Object_clone0,
    /* java.lang.Float methods */
    java_lang_Float_floatToIntBits,
    java_lang_Float_intBitsToFloat,
    java_lang_Float_parseFloat,
    java_lang_Float_toString0,
    /* javax.events package */
    javax_events_Events_getEventsCount,
    javax_events_Events_eventThreadRegister,
    javax_events_Events_getEvent,
    javax_events_Events_clearPendingFireCount,
    javax_events_Timer_getExpiredId,
    javax_events_Timer_start0,
    javax_events_Timer_getTimersCount,
    /* lpc2xxx.hw.Console */
    lpc2xxx_hw_Console_print,
    lpc2xxx_hw_Console_getKey,
    lpc2xxx_hw_Console_keyAvail,
    lpc2xxx_hw_Console_putch,
    /* lpc2xxx.hw.GPIO */
    lpc2xxx_hw_GPIO_read,
    lpc2xxx_hw_GPIO_set,
    lpc2xxx_hw_GPIO_clear,
    lpc2xxx_hw_GPIO_config,
    lpc2xxx_hw_GPIO_iodir,
    /* lpc2xxx.hw.RTC */
    lpc2xxx_hw_RTC_init,
    lpc2xxx_hw_RTC_set,
    lpc2xxx_hw_RTC_get,
    /* lpc2xxx.hw.PWM */
    lpc2xxx_hw_PWM_init0,
    lpc2xxx_hw_PWM_freq,
    lpc2xxx_hw_PWM_duty,
    lpc2xxx_hw_PWM_apply,
    /* lpc2xxx.comm.SPI */
    lpc2xxx_comm_SPI_init,
    lpc2xxx_comm_SPI_command,
    lpc2xxx_comm_SPI_ready,
    /* lpc2xxx.comm.UART */
    lpc2xxx_comm_UART_open0,
    lpc2xxx_comm_UART_close0,
    lpc2xxx_comm_UART_purge0,
    lpc2xxx_comm_UART_getStatus0,
    lpc2xxx_comm_UART_dataAvail,
    lpc2xxx_comm_UART_read0,
    lpc2xxx_comm_UART_write0,
    /* lpc2xxx.comm.I2C */
    lpc2xxx_comm_I2C_init0,
    lpc2xxx_comm_I2C_start,
    lpc2xxx_comm_I2C_reStart,
    lpc2xxx_comm_I2C_stop,
    lpc2xxx_comm_I2C_status,
    lpc2xxx_comm_I2C_write,
    lpc2xxx_comm_I2C_read,
    lpc2xxx_comm_I2C_poll,
    /* lpc2xxx.hw.ADC */
    lpc2xxx_hw_ADC_init,
    lpc2xxx_hw_ADC_get,
    lpc2xxx_hw_ADC_getmV,
    /* lpc2xxx.hw.DAC */
    lpc2xxx_hw_DAC_set
};




